package com.github.prontera.domain.enums;

import com.github.prontera.common.mybatis.handler.CodeEnum;

/**
 * 通用枚举类型
 */
public enum OrderAcceptStatusEnum implements CodeEnum<OrderAcceptStatusEnum> {

	WAIT_ACCEPT(0, "待接受"), CARRY(1, "进行中"), FINISHED(2, "已结束"), REFUNDS(3, "退款中")
	, UNACCEPTED(4, "未接受");

	private int code;
	private String desc;
	

	/**
     * 通过枚举<code>name</code>获取枚举
     */
    public static OrderAcceptStatusEnum getEnumByCode(Integer code) {
    	if(code==null){
    		return null;
    	}
        for (OrderAcceptStatusEnum enumm : OrderAcceptStatusEnum.values()) {
            if (enumm.getCode()==code.intValue()) {
                return enumm;
            }
        }
        return null;
    }
	
	private OrderAcceptStatusEnum(int code, String desc) {
		this.code = code;
		this.desc=desc;
	}

	@Override
	public int getCode() {
		return code;
	}

	public String getDesc() {
		return desc;
	}

}
